﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TMV.Report
{
	/// <summary>
	/// 构造上传需要的数据包
	/// </summary>
	public class DataTransform
	{
		public byte[] user { get; set; }
		public byte[] password { get; set; }

		public DataTransform()
		{
			var _user = MyDES.DESEncrypt("dtszdc");
			var _password = MyDES.DESEncrypt("SzR*@@22");
			this.user = _user;
			this.password = _password;
			//this.user = Encoding.GetEncoding("GBK").GetBytes(_user);
			//this.password = Encoding.GetEncoding("GBK").GetBytes(_password);
		}
		public string DataDesc(string dateFormat, string carNo)
		{
			return carNo + dateFormat;
		}

		public byte[]? XMLData(Real udata)
		{
			 
			var xmlData = new 汽车衡接口信息() { 详细信息 = new Detail() { 车皮 = udata } };
			//这里查询赋值
			return MyXML.GetXMLData(xmlData);
		}
	}

	public class 汽车衡接口信息
	{
		public Detail 详细信息 { get; set; }
	}

	public class Detail
	{
		public Real 车皮 { get; set; }
	}

	public class Real
	{
		/// <summary>
		/// 过衡序号，代表数据唯一性
		/// </summary>
		public int ID { get; set; }
		/// <summary>
		/// 车牌号
		/// </summary>
		public string CHEPH { get; set; }
		/// <summary>
		/// 货物名称，名称中包含汉字“煤”
		/// </summary>
		public string PINZ { get; set; }
		/// <summary>
		/// 煤矿单位，与燃料系统保持一致
		/// </summary>
		public string MEIKDW { get; set; }
		/// <summary>
		/// 供应商名称，与燃料系统保持一致
		/// </summary>
		public string GONGYS { get; }
		/// <summary>
		/// 6.	发站，与燃料系统保持一致
		/// </summary>
		public string FAZ { get; set; }
		/// <summary>
		/// 到站，与燃料系统保持一致
		/// </summary>
		public string DAOZ { get; set; }
		/// <summary>
		/// 毛重
		/// </summary>
		public double MAOZ { get; set; }
		/// <summary>
		/// 皮重
		/// </summary>
		public double PIZ { get; set; }
		/// <summary>
		/// 发货日期 yyyy-mm-dd
		/// </summary>
		public DateTime FAHRQ { get; set; }
		/// <summary>
		/// 到货日期，车辆回皮结束后离厂时间 yyyy-mm-dd
		/// </summary>
		public DateTime DAOHRQ { get; set; }
		/// <summary>
		/// 口径类型
		/// </summary>
		public string KOUJ { get; set; }
		/// <summary>
		/// 运输方式
		/// </summary>
		public string YUNSFS { get; set; }
		/// <summary>
		/// 检斤方式
		/// </summary>
		public string JIANJFS { get; set; }
		/// <summary>
		/// 进厂司磅员
		/// </summary>
		public string JINCJJY { get; set; }
		/// <summary>
		/// 出厂司磅员
		/// </summary>
		public string CHUCJJY { get; set; }
		/// <summary>
		/// 进厂时间 yyyy-mm-dd hh24:mi:ss
		/// </summary>
		public DateTime JINCSJ { get; set; }
		/// <summary>
		/// 出厂时间 yyyy-mm-dd hh24:mi:ss
		/// </summary>
		public DateTime CHUCSJ { get; set; }
		/// <summary>
		/// 扣重
		/// </summary>
		public double KOUZ { get; set; }
		/// <summary>
		/// 进厂秤号
		/// </summary>
		public string JINCHH { get; set; }
		/// <summary>
		/// 出厂秤号
		/// </summary>
		public string CHUCHH { get; set; }
		/// <summary>
		/// 承运单位
		/// </summary>
		public string CHENGYDW { get; set; }
		/// <summary>
		/// 车次
		/// </summary>
		public string CHEC { get; set; }
	}
}
